/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #1D2129;
    background-color: #F7F8FA;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 自定义动画类 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* 工具类 */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(135deg, #165DFF 0%, #0FC6C2 100%);
}

.bg-gradient {
    background: linear-gradient(135deg, #165DFF 0%, #0FC6C2 100%);
}

.card-shadow {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

/* 按钮效果 */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* 输入框聚焦动画 */
.form-input:focus {
    transition: all 0.3s ease;
    transform: translateY(-2px);
}

/* 轮播图样式 */
.carousel-container {
    height: 100%;
}

.carousel-item {
    opacity: 0;
    visibility: hidden;
}

.carousel-item.active {
    opacity: 1;
    visibility: visible;
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* 无障碍优化 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #f5f5f5;
        --card-bg: #2d2d2d;
    }
}

/* 性能优化 */
.image-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.image-lazy.loaded {
    opacity: 1;
}

/* 自定义选择文本样式 */
::selection {
    background: rgba(22, 93, 255, 0.2);
    color: #165DFF;
}

::-moz-selection {
    background: rgba(22, 93, 255, 0.2);
    color: #165DFF;
}

/* 焦点样式优化 */
*:focus-visible {
    outline: 2px solid #165DFF;
    outline-offset: 2px;
}

/* 数字计数动画 */
.count-animation {
    transition: all 0.5s ease;
}

/* 错误页面样式 */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-code {
    font-size: 120px;
    font-weight: 900;
    color: #165DFF;
    line-height: 1;
    margin-bottom: 20px;
}

.error-message {
    font-size: 24px;
    color: #1D2129;
    margin-bottom: 30px;
}

/* 成功页面样式 */
.success-container {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #00B42A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon i {
    font-size: 40px;
    color: white;
}

.success-message {
    font-size: 24px;
    color: #1D2129;
    margin-bottom: 30px;
}

/* 加载指示器 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(22, 93, 255, 0.2);
    border-radius: 50%;
    border-top-color: #165DFF;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 进度条样式 */
.progress-bar {
    height: 6px;
    background: #E5E6EB;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #165DFF, #0FC6C2);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* 徽章样式 */
.badge-pulse {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
    }
}